#ifndef UI_H
#define UI_H

#include <ncurses.h>
#include "../chess_logic/chess_logic.h"

// 界面函数
void show_welcome_screen();
void show_login_screen();
void show_register_screen();
void show_main_menu();
void show_online_players_screen();
void show_game_screen(ChessGame *game, bool is_ai_game);

// 输入处理
void handle_login_input();
void handle_register_input();
void handle_main_menu_input();
void handle_online_players_input();
void handle_game_input(ChessGame *game, bool is_ai_game);

// 辅助函数
void draw_chess_board(ChessGame *game);
void draw_piece(int row, int col, char piece);
void draw_selection(int row, int col, bool selected);
void draw_status_bar(ChessGame *game, bool is_ai_game);
void draw_promotion_dialog(ChessGame *game);

// 添加这些函数声明
void online_players_screen();
void start_pvp_game(int opponent_id, char *opponent_name, int opponent_elo, bool is_white);
void game_loop(ChessGame *game, bool is_ai_game, int opponent_id);
void handle_player_input(ChessGame *game);

#endif
